Re: ERROR: ExecEvalAggref - Mailing list pgsql-general

From eric soroos
Subject Re: ERROR: ExecEvalAggref
Date
Msg-id 94844485.1168286372@[4.42.179.151]
Whole thread Raw
In response to Re: ERROR: ExecEvalAggref  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> In general, aggregates at the top level of an UPDATE are ill-defined
> (the SQL spec prohibits them outright, and probably we should too).

In cases like this, it's probably better if it had never worked rather than failing for no apparent reason once it got
intoproduction.  

> You will perhaps have better luck with a query structured like
>
>     update dl_profile set
>     city = (select profiler(...) from ... where FOO)
>     where BAR

I've recast this as the following to allow for more fields without adding a subselect for each field.

update dl_profile set
    _incomingSubject= calc._incomingSubject
     ...
from (select
    profiler(concat(dl_event._eventDate,dl_event._incomingSubject) as _incomingSubject
     ...
    from dl_event where dl_event._donorNum='6'
                        and dl_event._flDeleted='f'
    ) as calc
where dl_profile._donorNum='6';


This is working now, thanks for the help.

eric




pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: Query gone wild
Next
From: Richard A Lough
Date:
Subject: Re: [NOVICE] Perl - Postgres